package com.rfsp.mcp.controller.base;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.ui.ModelMap;

public class BaseController extends com.rfsp.common.base.BaseController{
	
	public Logger logger = LoggerFactory.getLogger(BaseController.class);

    protected String errorAidNotMatch(ModelMap model){
    	logger.info("无权限访问");
        model.put("msg","无权限访问");
        return "base/error/aidNotMatch";
    };

    protected String alertContentReload(ModelMap model, String msg){
        model.put("msg",msg);
        return "base/bridge/alertContentReload";
    };
    protected String parentReload(ModelMap model){
        return "base/bridge/parentReload";
    }
    protected String topReload(ModelMap model){
        return "base/bridge/topReload";
    }
    protected String alertParentCloseFrameWindow(ModelMap model, String msg){
        model.put("msg",msg);
        return "base/bridge/alertParentCloseFrameWindow";
    };

    protected String alertParentReload(ModelMap model, String msg){
        model.put("msg",msg);
        return "base/bridge/alertParentReload";
    }
    protected String alert(ModelMap model, String msg){
        model.put("msg",msg);
        return "base/bridge/alert";
    }
    protected String alertLocation(ModelMap model, String msg,String url){
        model.put("msg",msg);
        model.put("url",url);
        return "base/bridge/alertLocation";
    }
    protected String alertBack(ModelMap model, String msg){
        model.put("msg",msg);
        return "base/bridge/alertBack";
    }
    protected String alertParentLocation(ModelMap model, String msg,String url){
        model.put("msg",msg);
        model.put("url",url);
        return "base/bridge/alertParentLocation";
    }

    @Value("${server.servlet.context-path}")
    private String contextPath;

    protected String getContextPath(){
        return contextPath;
    }
}
